<?php
/* @var $this CompanyController */
/* @var $model Company */

$this->breadcrumbs=array(
	'Companies'=>array('index'),
	$model->title=>array('view','id'=>$model->id),
	'editInfo',
); 
?> 

<script type="text/javascript"> 
   function check_count(string){ 
    var a=$("#"+string).val().length;   
       if(a >110){
        $("#"+string).val($("#"+string).val().substring(0, 110)); 
       } 
     }
</script>
<h1>修改基本信息</h1> 

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'company-form',
    'enableAjaxValidation'=>false,
    'htmlOptions' => array('enctype'=>'multipart/form-data'),
)); ?> 
    <p style="color: red;font-size: 14px;"> <?php echo empty($message)?'':''.$message; ?></p>
    <p class="note"><span class="required">*</span> 是必填内容.</p> 

    <?php //echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model,'logo'); ?>
        <?php echo CHtml::activeFileField($model,'logo'); ?>
        <?php echo CHtml::label("建议：220px * 76px",false); ?>
        <?php echo $form->error($model,'logo'); ?>
    </div>

    <div class='row'> 
        <?php  
          if($model->logo !==null){ 
            echo CHtml::label("企业logo预览",false); 
            echo CHtml::image(Yii::app()->baseUrl.$model->logo,'',array("height"=>"76px")); 
          }  
         ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'description'); ?>
        <?php echo $form->textArea($model,'description',array('rows'=>6, 'cols'=>50,'id'=>'description',"onkeyup"=>"check_count('description')",'onblur'=>"check_count('description')",));  ?>
        <?php echo CHtml::label('最多输入110个字',false); ?>
        <?php echo $form->error($model,'description'); ?>
    </div> 

    <div class="row">
        <?php echo $form->labelEx($model,'tel'); ?>
        <?php echo $form->textField($model,'tel'); ?>
        <?php echo $form->error($model,'tel'); ?>
    </div> 

    <div class="row">
        <?php echo $form->labelEx($model,'address'); ?>
        <?php echo $form->textField($model,'address'); ?>
        <?php echo $form->error($model,'address'); ?>
    </div> 
  

    <div class="row buttons">
        <?php echo CHtml::submitButton($model->isNewRecord ? '新增' : '修改',array('class'=>'subButton')); ?>
    </div>

<?php $this->endWidget(); ?>

</div><!-- form -->